import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/base/app_title.dart';
import 'package:online_study/mine/integral/integral_rules.dart';
import 'package:online_study/mine/integral/my_integral.dart';
import 'package:online_study/mine/integral/my_medal.dart';
import 'package:online_study/mine/integral/sign_in.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//积分中心
class IntegralCenterPage extends StatefulWidget {
  @override
  _IntegralCenterPageState createState() => _IntegralCenterPageState();
}

class _IntegralCenterPageState extends State<IntegralCenterPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: BackButton(color: ThemeColor.color333333),
        titleSpacing: 0,
        elevation: ThemeSize.appElevation,
        backgroundColor: ThemeColor.colorWhite,
        title: AppTitle("积分中心"),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            _buildInfo(),
            SignInPage(),
            MedalPage(),
            MyIntegralPage()],
        ),
      ),
    );
  }

  Widget _buildInfo() {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: ThemeSize.width19),
      width: double.infinity,
      color: ThemeColor.color1485EE,
      height: ThemeSize.height100,
      child: Row(
        children: [
          Expanded(
              child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text("我的积分",
                  style: TextStyle(
                      color: ThemeColor.colorWhite, fontSize: ThemeSize.sp15)),
              Container(
                margin: EdgeInsets.only(top: ThemeSize.height12),
                child: Text("1688",
                    style: TextStyle(
                        color: ThemeColor.colorWhite,
                        fontSize: ThemeSize.sp38)),
              )
            ],
          )),
          Container(
            alignment: Alignment.center,
            height: ThemeSize.height36,
            width: ThemeSize.width95,
            decoration: BoxDecoration(
                color: ThemeColor.colorWhite,
                borderRadius: BorderRadius.circular(ThemeSize.height18)),
            child: GestureDetector(
              child: Text(
                "积分规则",
                style: TextStyle(
                    color: ThemeColor.color1485EE, fontSize: ThemeSize.sp16),
              ),
              onTap: () {
                Get.to(() => IntegralRulesPage());
              },
            ),
          )
        ],
      ),
    );
  }
}
